package xcmg.device.dao.mapper.account;


import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import xcmg.device.dao.entity.account.InvoiceDetailDO;
import xcmg.device.service.vo.account.InvoiceDetailVO;

import java.util.List;

@Mapper
public interface InvoiceDetailMapper {

    int deleteByPrimaryKey(String id);

    int insert(InvoiceDetailDO record);

    InvoiceDetailDO selectByPrimaryKey(String id);

    int update(InvoiceDetailDO record);

    List<InvoiceDetailDO> list(InvoiceDetailVO condition);

    List<String> findDeliveryNo(@Param("invoiceNo")String invoiceNo, @Param("orgId")String orgId);

    int countDeliveryNo(@Param("invoiceNo")String invoiceNo, @Param("orgId")String orgId);

    /**
     * 业务上，按照此条件应该查出来唯一数据，但是系统中现在存在多条重复脏数据，所以给个list，查出来再做处理
     *
     * @param invoiceNo
     * @param deliveryProNo
     * @param materialsNo
     * @param orgId
     * @return
     */
    List<InvoiceDetailDO> listByMaterialsNo(@Param("invoiceNo") String invoiceNo,@Param("deliveryNo") String deliveryNo,@Param("deliveryProNo") String deliveryProNo,
        @Param("materialsNo") String materialsNo,@Param("orgId") String orgId);
}